#include <stdio.h>
#include <ctype.h>
#include <string.h>

#define LIMIT 81

void ToUpper(char * str);
int PunctCount(char * str);

int main(void)
{
    char line[LIMIT];
    char * find;

    printf("Please enter a line: \n");
    fgets(line, LIMIT, stdin);
    find = strchr(line, '\n');
    if (find)
        *find = '\0';

    ToUpper(line);
    puts(line);

    printf("That line has %d punctuation characters.", PunctCount(line));

    return 0;
}

void ToUpper(char * str)
{
    int i;

    for (i = 0; str[i] != '\0'; i++)
        str[i] = toupper(str[i]);
}

int PunctCount(char * str)
{
    int ct;

    while (*str)
    {
        if (ispunct(*str))
            ct++;
        str++;
    }  
    

    return ct;
}